<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template special_values_parser</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../date_time/doxy.html#doxygen.date_time_reference.special__values__parser_8hpp" title="Header &lt;boost/date_time/special_values_parser.hpp&gt;">
<link rel="prev" href="classboost_1_1date__time_1_1special__values__formatter.html" title="Class template special_values_formatter">
<link rel="next" href="string__convert_8hpp_1af9124db466d9cd3b2d1de5a7eaf9f365.html" title="Function template convert_string_type">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1date__time_1_1special__values__formatter.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#doxygen.date_time_reference.special__values__parser_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="string__convert_8hpp_1af9124db466d9cd3b2d1de5a7eaf9f365.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template special_values_parser</span></h2>
<p>boost::date_time::special_values_parser — Class for special_value parsing. </p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../date_time/doxy.html#doxygen.date_time_reference.special__values__parser_8hpp" title="Header &lt;boost/date_time/special_values_parser.hpp&gt;">boost/date_time/special_values_parser.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> date_type<span class="special">,</span> <span class="keyword">typename</span> charT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html" title="Class template special_values_parser">special_values_parser</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span>                <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1ac584f114dc405b69e35052a3ab09e66e"></a><span class="identifier">string_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_stringstream</span><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span>          <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a910f53f02ee1557b6a88b27d07fa56a9"></a><span class="identifier">stringstream_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">istreambuf_iterator</span><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span>         <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a9b9acc3e304a29fe9cd03db4e8f892f9"></a><span class="identifier">stream_itr_type</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="identifier">date_type</span><span class="special">::</span><span class="identifier">duration_type</span>                  <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a646bb536cc65ca7b7ebbc0d7561b98f3"></a><span class="identifier">duration_type</span><span class="special">;</span>    
  <span class="keyword">typedef</span> <a class="link" href="structboost_1_1date__time_1_1string__parse__tree.html" title="Struct template string_parse_tree">string_parse_tree</a><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span>                <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a0a4286ae22ab0df787eeee25926081d8"></a><span class="identifier">parse_tree_type</span><span class="special">;</span>  
  <span class="keyword">typedef</span> parse_tree_type::parse_match_result_type  <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1ad0b742d61cfdea99324eaf2843f762ba"></a><span class="identifier">match_results</span><span class="special">;</span>    
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1ad90a88824da5985350f0da30dbb02260"></a><span class="identifier">collection_type</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="identifier">charT</span>                                     <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1ad79f9934a57ad48a85ab8513758acb1a"></a><span class="identifier">char_type</span><span class="special">;</span>        

  <span class="comment">// <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#id-1_3_11_15_3_41_1_1_1_17-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a1f46e46246191f33955519db63b52eb3"><span class="identifier">special_values_parser</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a145b0bb60bbcc831b04cf471c151b9ce"><span class="identifier">special_values_parser</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                        <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                        <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a8d41e3247537373a2ccf3589987b48ce"><span class="identifier">special_values_parser</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">collection_type</span><span class="special">::</span><span class="identifier">iterator</span><span class="special">,</span> 
                        <span class="keyword">typename</span> <span class="identifier">collection_type</span><span class="special">::</span><span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1ac74266fe3fd5f0579e523b743684e4ee"><span class="identifier">sv_strings</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                  <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                  <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a6ff661c76b6018753bfc2b69f2fd4542"><span class="identifier">match</span></a><span class="special">(</span><span class="identifier">stream_itr_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">stream_itr_type</span> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1ad0b742d61cfdea99324eaf2843f762ba">match_results</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#id-1_3_11_15_3_41_1_1_1_18-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="keyword">bool</span> <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a13e84235abdc12a450ad436837820e91"><span class="identifier">should_call_match</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// public data members</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="identifier">nadt_string</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="identifier">neg_inf_string</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="identifier">pos_inf_string</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="identifier">min_date_time_string</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="identifier">max_date_time_string</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.11.15.3.40.3.4"></a><h2>Description</h2>
<p>TODO: add doc-comments for which elements can be changed Parses input stream for strings representing special_values. Special values parsed are:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>not_a_date_time</p></li>
<li class="listitem"><p>neg_infin</p></li>
<li class="listitem"><p>pod_infin</p></li>
<li class="listitem"><p>min_date_time</p></li>
<li class="listitem"><p>max_date_time </p></li>
</ul></div>
<p>
</p>
<div class="refsect2">
<a name="id-1.3.11.15.3.40.3.4.3"></a><h3>
<a name="id-1_3_11_15_3_41_1_1_1_17-bb"></a><code class="computeroutput">special_values_parser</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a1f46e46246191f33955519db63b52eb3"></a><span class="identifier">special_values_parser</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Creates a <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html" title="Class template special_values_parser">special_values_parser</a> with the default set of "sv_strings". </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a145b0bb60bbcc831b04cf471c151b9ce"></a><span class="identifier">special_values_parser</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> nadt_str<span class="special">,</span> 
                      <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> neg_inf_str<span class="special">,</span> 
                      <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> pos_inf_str<span class="special">,</span> 
                      <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> min_dt_str<span class="special">,</span> 
                      <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> max_dt_str<span class="special">)</span><span class="special">;</span></pre>Creates a <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html" title="Class template special_values_parser">special_values_parser</a> using a user defined set of element strings. </li>
<li class="listitem"><pre class="literallayout"><a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a8d41e3247537373a2ccf3589987b48ce"></a><span class="identifier">special_values_parser</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">collection_type</span><span class="special">::</span><span class="identifier">iterator</span> beg<span class="special">,</span> 
                      <span class="keyword">typename</span> <span class="identifier">collection_type</span><span class="special">::</span><span class="identifier">iterator</span> end<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1ac74266fe3fd5f0579e523b743684e4ee"></a><span class="identifier">sv_strings</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> nadt_str<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> neg_inf_str<span class="special">,</span> 
                <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> pos_inf_str<span class="special">,</span> 
                <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> min_dt_str<span class="special">,</span> 
                <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> max_dt_str<span class="special">)</span><span class="special">;</span></pre>Replace special value strings. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a6ff661c76b6018753bfc2b69f2fd4542"></a><span class="identifier">match</span><span class="special">(</span><span class="identifier">stream_itr_type</span> <span class="special">&amp;</span> sitr<span class="special">,</span> <span class="identifier">stream_itr_type</span> <span class="special">&amp;</span> str_end<span class="special">,</span> 
           <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1ad0b742d61cfdea99324eaf2843f762ba">match_results</a> <span class="special">&amp;</span> mr<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Given an input iterator, attempt to match it to a known special value 

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">sitr</code></span></p></td>
<td><p>the start iterator </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">str_end</code></span></p></td>
<td><p>the end iterator </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mr</code></span></p></td>
<td><p>the match result: mr.current_match is set to the corresponding special_value or -1 </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>whether something matched </p></td>
</tr>
</tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.11.15.3.40.3.4.4"></a><h3>
<a name="id-1_3_11_15_3_41_1_1_1_18-bb"></a><code class="computeroutput">special_values_parser</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">bool</span> <a name="doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a13e84235abdc12a450ad436837820e91"></a><span class="identifier">should_call_match</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&amp;</span> str<span class="special">)</span><span class="special">;</span></pre>
<p>The parser is expensive to create, and not thread-safe so it cannot be static therefore given a string, determine if it is likely to be a special value. A negative response is a definite no, whereas a positive is only likely and <a class="link" href="classboost_1_1date__time_1_1special__values__parser.html#doxygen.date_time_reference.classboost_1_1date__time_1_1special__values__parser_1a6ff661c76b6018753bfc2b69f2fd4542">match()</a> should be called and return value checked. 

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">str</code></span></p></td>
<td><p>the string to check </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>false if it is definitely not a special value </p></td>
</tr>
</tbody>
</table></div>
</li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2001-2005 CrystalClear Software, Inc<p>Subject to the Boost Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1date__time_1_1special__values__formatter.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#doxygen.date_time_reference.special__values__parser_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="string__convert_8hpp_1af9124db466d9cd3b2d1de5a7eaf9f365.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
